// $ANTLR 3.4 src/main/resources/Model.g 2012-02-18 23:27:45
package samples;

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.tree.*;


@SuppressWarnings({"all", "warnings", "unchecked"})
public class ModelParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "CLSS_DECL", "COMMENT", "FIELD_DECL", "IDENTIFIER", "IDXF_DECL", "INDX_DECL", "ITFA_DECL", "LINE_COMMENT", "MEMBERS", "METHOD_DECL", "MODF_DECL", "REL_DECL", "TYPE_DECL", "UNIT", "WS", "'\"'", "'('", "')'", "','", "'.'", "';'", "'='", "'[]'", "'abstract'", "'class'", "'extends'", "'implements'", "'import'", "'interface'", "'null'", "'package'", "'public'", "'static'", "'{'", "'}'"
    };

    public static final int EOF=-1;
    public static final int T__19=19;
    public static final int T__20=20;
    public static final int T__21=21;
    public static final int T__22=22;
    public static final int T__23=23;
    public static final int T__24=24;
    public static final int T__25=25;
    public static final int T__26=26;
    public static final int T__27=27;
    public static final int T__28=28;
    public static final int T__29=29;
    public static final int T__30=30;
    public static final int T__31=31;
    public static final int T__32=32;
    public static final int T__33=33;
    public static final int T__34=34;
    public static final int T__35=35;
    public static final int T__36=36;
    public static final int T__37=37;
    public static final int T__38=38;
    public static final int CLSS_DECL=4;
    public static final int COMMENT=5;
    public static final int FIELD_DECL=6;
    public static final int IDENTIFIER=7;
    public static final int IDXF_DECL=8;
    public static final int INDX_DECL=9;
    public static final int ITFA_DECL=10;
    public static final int LINE_COMMENT=11;
    public static final int MEMBERS=12;
    public static final int METHOD_DECL=13;
    public static final int MODF_DECL=14;
    public static final int REL_DECL=15;
    public static final int TYPE_DECL=16;
    public static final int UNIT=17;
    public static final int WS=18;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public ModelParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public ModelParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

protected TreeAdaptor adaptor = new CommonTreeAdaptor();

public void setTreeAdaptor(TreeAdaptor adaptor) {
    this.adaptor = adaptor;
}
public TreeAdaptor getTreeAdaptor() {
    return adaptor;
}
    public String[] getTokenNames() { return ModelParser.tokenNames; }
    public String getGrammarFileName() { return "src/main/resources/Model.g"; }


    public static class compilationUnit_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "compilationUnit"
    // src/main/resources/Model.g:39:1: compilationUnit : ( packageDeclaration )? ( importDeclaration )* ( typeDeclaration )+ -> ^( UNIT ( typeDeclaration )+ ) ;
    public final ModelParser.compilationUnit_return compilationUnit() throws RecognitionException {
        ModelParser.compilationUnit_return retval = new ModelParser.compilationUnit_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        ModelParser.packageDeclaration_return packageDeclaration1 =null;

        ModelParser.importDeclaration_return importDeclaration2 =null;

        ModelParser.typeDeclaration_return typeDeclaration3 =null;


        RewriteRuleSubtreeStream stream_packageDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule packageDeclaration");
        RewriteRuleSubtreeStream stream_typeDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule typeDeclaration");
        RewriteRuleSubtreeStream stream_importDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule importDeclaration");
        try {
            // src/main/resources/Model.g:40:5: ( ( packageDeclaration )? ( importDeclaration )* ( typeDeclaration )+ -> ^( UNIT ( typeDeclaration )+ ) )
            // src/main/resources/Model.g:40:9: ( packageDeclaration )? ( importDeclaration )* ( typeDeclaration )+
            {
            // src/main/resources/Model.g:40:9: ( packageDeclaration )?
            int alt1=2;
            int LA1_0 = input.LA(1);

            if ( (LA1_0==34) ) {
                alt1=1;
            }
            switch (alt1) {
                case 1 :
                    // src/main/resources/Model.g:40:10: packageDeclaration
                    {
                    pushFollow(FOLLOW_packageDeclaration_in_compilationUnit135);
                    packageDeclaration1=packageDeclaration();

                    state._fsp--;

                    stream_packageDeclaration.add(packageDeclaration1.getTree());

                    }
                    break;

            }


            // src/main/resources/Model.g:41:9: ( importDeclaration )*
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( (LA2_0==31) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // src/main/resources/Model.g:41:10: importDeclaration
            	    {
            	    pushFollow(FOLLOW_importDeclaration_in_compilationUnit148);
            	    importDeclaration2=importDeclaration();

            	    state._fsp--;

            	    stream_importDeclaration.add(importDeclaration2.getTree());

            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);


            // src/main/resources/Model.g:42:9: ( typeDeclaration )+
            int cnt3=0;
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( ((LA3_0 >= 27 && LA3_0 <= 28)||LA3_0==32||(LA3_0 >= 35 && LA3_0 <= 36)) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // src/main/resources/Model.g:42:10: typeDeclaration
            	    {
            	    pushFollow(FOLLOW_typeDeclaration_in_compilationUnit161);
            	    typeDeclaration3=typeDeclaration();

            	    state._fsp--;

            	    stream_typeDeclaration.add(typeDeclaration3.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);


            // AST REWRITE
            // elements: typeDeclaration
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 43:5: -> ^( UNIT ( typeDeclaration )+ )
            {
                // src/main/resources/Model.g:43:8: ^( UNIT ( typeDeclaration )+ )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(UNIT, "UNIT")
                , root_1);

                if ( !(stream_typeDeclaration.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_typeDeclaration.hasNext() ) {
                    adaptor.addChild(root_1, stream_typeDeclaration.nextTree());

                }
                stream_typeDeclaration.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "compilationUnit"


    public static class packageDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "packageDeclaration"
    // src/main/resources/Model.g:46:1: packageDeclaration : 'package' qualifiedName ';' ;
    public final ModelParser.packageDeclaration_return packageDeclaration() throws RecognitionException {
        ModelParser.packageDeclaration_return retval = new ModelParser.packageDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token string_literal4=null;
        Token char_literal6=null;
        ModelParser.qualifiedName_return qualifiedName5 =null;


        ModelAST string_literal4_tree=null;
        ModelAST char_literal6_tree=null;

        try {
            // src/main/resources/Model.g:47:5: ( 'package' qualifiedName ';' )
            // src/main/resources/Model.g:47:9: 'package' qualifiedName ';'
            {
            root_0 = (ModelAST)adaptor.nil();


            string_literal4=(Token)match(input,34,FOLLOW_34_in_packageDeclaration196); 
            string_literal4_tree = 
            (ModelAST)adaptor.create(string_literal4)
            ;
            adaptor.addChild(root_0, string_literal4_tree);


            pushFollow(FOLLOW_qualifiedName_in_packageDeclaration198);
            qualifiedName5=qualifiedName();

            state._fsp--;

            adaptor.addChild(root_0, qualifiedName5.getTree());

            char_literal6=(Token)match(input,24,FOLLOW_24_in_packageDeclaration200); 
            char_literal6_tree = 
            (ModelAST)adaptor.create(char_literal6)
            ;
            adaptor.addChild(root_0, char_literal6_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "packageDeclaration"


    public static class importDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "importDeclaration"
    // src/main/resources/Model.g:50:1: importDeclaration : 'import' qualifiedName ';' ;
    public final ModelParser.importDeclaration_return importDeclaration() throws RecognitionException {
        ModelParser.importDeclaration_return retval = new ModelParser.importDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token string_literal7=null;
        Token char_literal9=null;
        ModelParser.qualifiedName_return qualifiedName8 =null;


        ModelAST string_literal7_tree=null;
        ModelAST char_literal9_tree=null;

        try {
            // src/main/resources/Model.g:51:5: ( 'import' qualifiedName ';' )
            // src/main/resources/Model.g:51:9: 'import' qualifiedName ';'
            {
            root_0 = (ModelAST)adaptor.nil();


            string_literal7=(Token)match(input,31,FOLLOW_31_in_importDeclaration221); 
            string_literal7_tree = 
            (ModelAST)adaptor.create(string_literal7)
            ;
            adaptor.addChild(root_0, string_literal7_tree);


            pushFollow(FOLLOW_qualifiedName_in_importDeclaration223);
            qualifiedName8=qualifiedName();

            state._fsp--;

            adaptor.addChild(root_0, qualifiedName8.getTree());

            char_literal9=(Token)match(input,24,FOLLOW_24_in_importDeclaration225); 
            char_literal9_tree = 
            (ModelAST)adaptor.create(char_literal9)
            ;
            adaptor.addChild(root_0, char_literal9_tree);


            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "importDeclaration"


    public static class qualifiedName_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "qualifiedName"
    // src/main/resources/Model.g:54:1: qualifiedName : IDENTIFIER ( '.' IDENTIFIER )* -> ( IDENTIFIER )+ ;
    public final ModelParser.qualifiedName_return qualifiedName() throws RecognitionException {
        ModelParser.qualifiedName_return retval = new ModelParser.qualifiedName_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token IDENTIFIER10=null;
        Token char_literal11=null;
        Token IDENTIFIER12=null;

        ModelAST IDENTIFIER10_tree=null;
        ModelAST char_literal11_tree=null;
        ModelAST IDENTIFIER12_tree=null;
        RewriteRuleTokenStream stream_23=new RewriteRuleTokenStream(adaptor,"token 23");
        RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");

        try {
            // src/main/resources/Model.g:55:5: ( IDENTIFIER ( '.' IDENTIFIER )* -> ( IDENTIFIER )+ )
            // src/main/resources/Model.g:55:9: IDENTIFIER ( '.' IDENTIFIER )*
            {
            IDENTIFIER10=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_qualifiedName249);  
            stream_IDENTIFIER.add(IDENTIFIER10);


            // src/main/resources/Model.g:55:20: ( '.' IDENTIFIER )*
            loop4:
            do {
                int alt4=2;
                int LA4_0 = input.LA(1);

                if ( (LA4_0==23) ) {
                    alt4=1;
                }


                switch (alt4) {
            	case 1 :
            	    // src/main/resources/Model.g:55:21: '.' IDENTIFIER
            	    {
            	    char_literal11=(Token)match(input,23,FOLLOW_23_in_qualifiedName252);  
            	    stream_23.add(char_literal11);


            	    IDENTIFIER12=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_qualifiedName254);  
            	    stream_IDENTIFIER.add(IDENTIFIER12);


            	    }
            	    break;

            	default :
            	    break loop4;
                }
            } while (true);


            // AST REWRITE
            // elements: IDENTIFIER
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 55:38: -> ( IDENTIFIER )+
            {
                if ( !(stream_IDENTIFIER.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_IDENTIFIER.hasNext() ) {
                    adaptor.addChild(root_0, 
                    stream_IDENTIFIER.nextNode()
                    );

                }
                stream_IDENTIFIER.reset();

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "qualifiedName"


    public static class typeDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "typeDeclaration"
    // src/main/resources/Model.g:58:1: typeDeclaration : ( interfaceDeclaration | classDeclaration );
    public final ModelParser.typeDeclaration_return typeDeclaration() throws RecognitionException {
        ModelParser.typeDeclaration_return retval = new ModelParser.typeDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        ModelParser.interfaceDeclaration_return interfaceDeclaration13 =null;

        ModelParser.classDeclaration_return classDeclaration14 =null;



        try {
            // src/main/resources/Model.g:59:5: ( interfaceDeclaration | classDeclaration )
            int alt5=2;
            switch ( input.LA(1) ) {
            case 35:
                {
                int LA5_1 = input.LA(2);

                if ( (LA5_1==32) ) {
                    alt5=1;
                }
                else if ( ((LA5_1 >= 27 && LA5_1 <= 28)||(LA5_1 >= 35 && LA5_1 <= 36)) ) {
                    alt5=2;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 5, 1, input);

                    throw nvae;

                }
                }
                break;
            case 32:
                {
                alt5=1;
                }
                break;
            case 27:
            case 28:
            case 36:
                {
                alt5=2;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;

            }

            switch (alt5) {
                case 1 :
                    // src/main/resources/Model.g:59:9: interfaceDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_interfaceDeclaration_in_typeDeclaration280);
                    interfaceDeclaration13=interfaceDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, interfaceDeclaration13.getTree());

                    }
                    break;
                case 2 :
                    // src/main/resources/Model.g:60:9: classDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_classDeclaration_in_typeDeclaration290);
                    classDeclaration14=classDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, classDeclaration14.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "typeDeclaration"


    public static class modifiers_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "modifiers"
    // src/main/resources/Model.g:63:1: modifiers : ( 'public' | 'abstract' | 'static' )* -> ^( MODF_DECL ( 'public' )? ( 'abstract' )? ( 'static' )? ) ;
    public final ModelParser.modifiers_return modifiers() throws RecognitionException {
        ModelParser.modifiers_return retval = new ModelParser.modifiers_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token string_literal15=null;
        Token string_literal16=null;
        Token string_literal17=null;

        ModelAST string_literal15_tree=null;
        ModelAST string_literal16_tree=null;
        ModelAST string_literal17_tree=null;
        RewriteRuleTokenStream stream_35=new RewriteRuleTokenStream(adaptor,"token 35");
        RewriteRuleTokenStream stream_36=new RewriteRuleTokenStream(adaptor,"token 36");
        RewriteRuleTokenStream stream_27=new RewriteRuleTokenStream(adaptor,"token 27");

        try {
            // src/main/resources/Model.g:64:5: ( ( 'public' | 'abstract' | 'static' )* -> ^( MODF_DECL ( 'public' )? ( 'abstract' )? ( 'static' )? ) )
            // src/main/resources/Model.g:65:5: ( 'public' | 'abstract' | 'static' )*
            {
            // src/main/resources/Model.g:65:5: ( 'public' | 'abstract' | 'static' )*
            loop6:
            do {
                int alt6=4;
                switch ( input.LA(1) ) {
                case 35:
                    {
                    alt6=1;
                    }
                    break;
                case 27:
                    {
                    alt6=2;
                    }
                    break;
                case 36:
                    {
                    alt6=3;
                    }
                    break;

                }

                switch (alt6) {
            	case 1 :
            	    // src/main/resources/Model.g:65:9: 'public'
            	    {
            	    string_literal15=(Token)match(input,35,FOLLOW_35_in_modifiers317);  
            	    stream_35.add(string_literal15);


            	    }
            	    break;
            	case 2 :
            	    // src/main/resources/Model.g:66:9: 'abstract'
            	    {
            	    string_literal16=(Token)match(input,27,FOLLOW_27_in_modifiers327);  
            	    stream_27.add(string_literal16);


            	    }
            	    break;
            	case 3 :
            	    // src/main/resources/Model.g:67:7: 'static'
            	    {
            	    string_literal17=(Token)match(input,36,FOLLOW_36_in_modifiers335);  
            	    stream_36.add(string_literal17);


            	    }
            	    break;

            	default :
            	    break loop6;
                }
            } while (true);


            // AST REWRITE
            // elements: 27, 35, 36
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 69:5: -> ^( MODF_DECL ( 'public' )? ( 'abstract' )? ( 'static' )? )
            {
                // src/main/resources/Model.g:69:9: ^( MODF_DECL ( 'public' )? ( 'abstract' )? ( 'static' )? )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(MODF_DECL, "MODF_DECL")
                , root_1);

                // src/main/resources/Model.g:69:21: ( 'public' )?
                if ( stream_35.hasNext() ) {
                    adaptor.addChild(root_1, 
                    stream_35.nextNode()
                    );

                }
                stream_35.reset();

                // src/main/resources/Model.g:69:31: ( 'abstract' )?
                if ( stream_27.hasNext() ) {
                    adaptor.addChild(root_1, 
                    stream_27.nextNode()
                    );

                }
                stream_27.reset();

                // src/main/resources/Model.g:69:43: ( 'static' )?
                if ( stream_36.hasNext() ) {
                    adaptor.addChild(root_1, 
                    stream_36.nextNode()
                    );

                }
                stream_36.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "modifiers"


    public static class interfaceDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "interfaceDeclaration"
    // src/main/resources/Model.g:72:1: interfaceDeclaration : ( 'public' )? 'interface' IDENTIFIER ( 'extends' type )? interfaceDeclarationBody -> ^( 'interface' IDENTIFIER ( ^( 'extends' type ) )? interfaceDeclarationBody ) ;
    public final ModelParser.interfaceDeclaration_return interfaceDeclaration() throws RecognitionException {
        ModelParser.interfaceDeclaration_return retval = new ModelParser.interfaceDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token string_literal18=null;
        Token string_literal19=null;
        Token IDENTIFIER20=null;
        Token string_literal21=null;
        ModelParser.type_return type22 =null;

        ModelParser.interfaceDeclarationBody_return interfaceDeclarationBody23 =null;


        ModelAST string_literal18_tree=null;
        ModelAST string_literal19_tree=null;
        ModelAST IDENTIFIER20_tree=null;
        ModelAST string_literal21_tree=null;
        RewriteRuleTokenStream stream_32=new RewriteRuleTokenStream(adaptor,"token 32");
        RewriteRuleTokenStream stream_35=new RewriteRuleTokenStream(adaptor,"token 35");
        RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
        RewriteRuleTokenStream stream_29=new RewriteRuleTokenStream(adaptor,"token 29");
        RewriteRuleSubtreeStream stream_interfaceDeclarationBody=new RewriteRuleSubtreeStream(adaptor,"rule interfaceDeclarationBody");
        RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
        try {
            // src/main/resources/Model.g:73:5: ( ( 'public' )? 'interface' IDENTIFIER ( 'extends' type )? interfaceDeclarationBody -> ^( 'interface' IDENTIFIER ( ^( 'extends' type ) )? interfaceDeclarationBody ) )
            // src/main/resources/Model.g:73:9: ( 'public' )? 'interface' IDENTIFIER ( 'extends' type )? interfaceDeclarationBody
            {
            // src/main/resources/Model.g:73:9: ( 'public' )?
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==35) ) {
                alt7=1;
            }
            switch (alt7) {
                case 1 :
                    // src/main/resources/Model.g:73:10: 'public'
                    {
                    string_literal18=(Token)match(input,35,FOLLOW_35_in_interfaceDeclaration386);  
                    stream_35.add(string_literal18);


                    }
                    break;

            }


            string_literal19=(Token)match(input,32,FOLLOW_32_in_interfaceDeclaration390);  
            stream_32.add(string_literal19);


            IDENTIFIER20=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_interfaceDeclaration392);  
            stream_IDENTIFIER.add(IDENTIFIER20);


            // src/main/resources/Model.g:74:9: ( 'extends' type )?
            int alt8=2;
            int LA8_0 = input.LA(1);

            if ( (LA8_0==29) ) {
                alt8=1;
            }
            switch (alt8) {
                case 1 :
                    // src/main/resources/Model.g:74:10: 'extends' type
                    {
                    string_literal21=(Token)match(input,29,FOLLOW_29_in_interfaceDeclaration403);  
                    stream_29.add(string_literal21);


                    pushFollow(FOLLOW_type_in_interfaceDeclaration405);
                    type22=type();

                    state._fsp--;

                    stream_type.add(type22.getTree());

                    }
                    break;

            }


            pushFollow(FOLLOW_interfaceDeclarationBody_in_interfaceDeclaration411);
            interfaceDeclarationBody23=interfaceDeclarationBody();

            state._fsp--;

            stream_interfaceDeclarationBody.add(interfaceDeclarationBody23.getTree());

            // AST REWRITE
            // elements: interfaceDeclarationBody, 32, type, IDENTIFIER, 29
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 76:5: -> ^( 'interface' IDENTIFIER ( ^( 'extends' type ) )? interfaceDeclarationBody )
            {
                // src/main/resources/Model.g:76:9: ^( 'interface' IDENTIFIER ( ^( 'extends' type ) )? interfaceDeclarationBody )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                stream_32.nextNode()
                , root_1);

                adaptor.addChild(root_1, 
                stream_IDENTIFIER.nextNode()
                );

                // src/main/resources/Model.g:76:34: ( ^( 'extends' type ) )?
                if ( stream_type.hasNext()||stream_29.hasNext() ) {
                    // src/main/resources/Model.g:76:35: ^( 'extends' type )
                    {
                    ModelAST root_2 = (ModelAST)adaptor.nil();
                    root_2 = (ModelAST)adaptor.becomeRoot(
                    stream_29.nextNode()
                    , root_2);

                    adaptor.addChild(root_2, stream_type.nextTree());

                    adaptor.addChild(root_1, root_2);
                    }

                }
                stream_type.reset();
                stream_29.reset();

                adaptor.addChild(root_1, stream_interfaceDeclarationBody.nextTree());

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "interfaceDeclaration"


    public static class classDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "classDeclaration"
    // src/main/resources/Model.g:79:1: classDeclaration : modifiers 'class' IDENTIFIER ( 'implements' typeList )? classDeclarationBody -> ^( 'class' IDENTIFIER ( ^( 'implements' typeList ) )? classDeclarationBody ) ;
    public final ModelParser.classDeclaration_return classDeclaration() throws RecognitionException {
        ModelParser.classDeclaration_return retval = new ModelParser.classDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token string_literal25=null;
        Token IDENTIFIER26=null;
        Token string_literal27=null;
        ModelParser.modifiers_return modifiers24 =null;

        ModelParser.typeList_return typeList28 =null;

        ModelParser.classDeclarationBody_return classDeclarationBody29 =null;


        ModelAST string_literal25_tree=null;
        ModelAST IDENTIFIER26_tree=null;
        ModelAST string_literal27_tree=null;
        RewriteRuleTokenStream stream_30=new RewriteRuleTokenStream(adaptor,"token 30");
        RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
        RewriteRuleTokenStream stream_28=new RewriteRuleTokenStream(adaptor,"token 28");
        RewriteRuleSubtreeStream stream_modifiers=new RewriteRuleSubtreeStream(adaptor,"rule modifiers");
        RewriteRuleSubtreeStream stream_typeList=new RewriteRuleSubtreeStream(adaptor,"rule typeList");
        RewriteRuleSubtreeStream stream_classDeclarationBody=new RewriteRuleSubtreeStream(adaptor,"rule classDeclarationBody");
        try {
            // src/main/resources/Model.g:80:5: ( modifiers 'class' IDENTIFIER ( 'implements' typeList )? classDeclarationBody -> ^( 'class' IDENTIFIER ( ^( 'implements' typeList ) )? classDeclarationBody ) )
            // src/main/resources/Model.g:80:9: modifiers 'class' IDENTIFIER ( 'implements' typeList )? classDeclarationBody
            {
            pushFollow(FOLLOW_modifiers_in_classDeclaration462);
            modifiers24=modifiers();

            state._fsp--;

            stream_modifiers.add(modifiers24.getTree());

            string_literal25=(Token)match(input,28,FOLLOW_28_in_classDeclaration464);  
            stream_28.add(string_literal25);


            IDENTIFIER26=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_classDeclaration466);  
            stream_IDENTIFIER.add(IDENTIFIER26);


            // src/main/resources/Model.g:81:9: ( 'implements' typeList )?
            int alt9=2;
            int LA9_0 = input.LA(1);

            if ( (LA9_0==30) ) {
                alt9=1;
            }
            switch (alt9) {
                case 1 :
                    // src/main/resources/Model.g:81:10: 'implements' typeList
                    {
                    string_literal27=(Token)match(input,30,FOLLOW_30_in_classDeclaration477);  
                    stream_30.add(string_literal27);


                    pushFollow(FOLLOW_typeList_in_classDeclaration479);
                    typeList28=typeList();

                    state._fsp--;

                    stream_typeList.add(typeList28.getTree());

                    }
                    break;

            }


            pushFollow(FOLLOW_classDeclarationBody_in_classDeclaration491);
            classDeclarationBody29=classDeclarationBody();

            state._fsp--;

            stream_classDeclarationBody.add(classDeclarationBody29.getTree());

            // AST REWRITE
            // elements: classDeclarationBody, 30, 28, typeList, IDENTIFIER
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 83:5: -> ^( 'class' IDENTIFIER ( ^( 'implements' typeList ) )? classDeclarationBody )
            {
                // src/main/resources/Model.g:83:9: ^( 'class' IDENTIFIER ( ^( 'implements' typeList ) )? classDeclarationBody )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                stream_28.nextNode()
                , root_1);

                adaptor.addChild(root_1, 
                stream_IDENTIFIER.nextNode()
                );

                // src/main/resources/Model.g:83:30: ( ^( 'implements' typeList ) )?
                if ( stream_30.hasNext()||stream_typeList.hasNext() ) {
                    // src/main/resources/Model.g:83:31: ^( 'implements' typeList )
                    {
                    ModelAST root_2 = (ModelAST)adaptor.nil();
                    root_2 = (ModelAST)adaptor.becomeRoot(
                    stream_30.nextNode()
                    , root_2);

                    adaptor.addChild(root_2, stream_typeList.nextTree());

                    adaptor.addChild(root_1, root_2);
                    }

                }
                stream_30.reset();
                stream_typeList.reset();

                adaptor.addChild(root_1, stream_classDeclarationBody.nextTree());

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "classDeclaration"


    public static class interfaceDeclarationBody_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "interfaceDeclarationBody"
    // src/main/resources/Model.g:86:1: interfaceDeclarationBody : '{' ( interfaceMemberDeclaration )* '}' -> ^( MEMBERS ( interfaceMemberDeclaration )* ) ;
    public final ModelParser.interfaceDeclarationBody_return interfaceDeclarationBody() throws RecognitionException {
        ModelParser.interfaceDeclarationBody_return retval = new ModelParser.interfaceDeclarationBody_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token char_literal30=null;
        Token char_literal32=null;
        ModelParser.interfaceMemberDeclaration_return interfaceMemberDeclaration31 =null;


        ModelAST char_literal30_tree=null;
        ModelAST char_literal32_tree=null;
        RewriteRuleTokenStream stream_37=new RewriteRuleTokenStream(adaptor,"token 37");
        RewriteRuleTokenStream stream_38=new RewriteRuleTokenStream(adaptor,"token 38");
        RewriteRuleSubtreeStream stream_interfaceMemberDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule interfaceMemberDeclaration");
        try {
            // src/main/resources/Model.g:87:5: ( '{' ( interfaceMemberDeclaration )* '}' -> ^( MEMBERS ( interfaceMemberDeclaration )* ) )
            // src/main/resources/Model.g:87:9: '{' ( interfaceMemberDeclaration )* '}'
            {
            char_literal30=(Token)match(input,37,FOLLOW_37_in_interfaceDeclarationBody535);  
            stream_37.add(char_literal30);


            // src/main/resources/Model.g:87:13: ( interfaceMemberDeclaration )*
            loop10:
            do {
                int alt10=2;
                int LA10_0 = input.LA(1);

                if ( (LA10_0==IDENTIFIER) ) {
                    alt10=1;
                }


                switch (alt10) {
            	case 1 :
            	    // src/main/resources/Model.g:87:13: interfaceMemberDeclaration
            	    {
            	    pushFollow(FOLLOW_interfaceMemberDeclaration_in_interfaceDeclarationBody537);
            	    interfaceMemberDeclaration31=interfaceMemberDeclaration();

            	    state._fsp--;

            	    stream_interfaceMemberDeclaration.add(interfaceMemberDeclaration31.getTree());

            	    }
            	    break;

            	default :
            	    break loop10;
                }
            } while (true);


            char_literal32=(Token)match(input,38,FOLLOW_38_in_interfaceDeclarationBody540);  
            stream_38.add(char_literal32);


            // AST REWRITE
            // elements: interfaceMemberDeclaration
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 88:5: -> ^( MEMBERS ( interfaceMemberDeclaration )* )
            {
                // src/main/resources/Model.g:88:9: ^( MEMBERS ( interfaceMemberDeclaration )* )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(MEMBERS, "MEMBERS")
                , root_1);

                // src/main/resources/Model.g:88:19: ( interfaceMemberDeclaration )*
                while ( stream_interfaceMemberDeclaration.hasNext() ) {
                    adaptor.addChild(root_1, stream_interfaceMemberDeclaration.nextTree());

                }
                stream_interfaceMemberDeclaration.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "interfaceDeclarationBody"


    public static class classDeclarationBody_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "classDeclarationBody"
    // src/main/resources/Model.g:91:1: classDeclarationBody : '{' ( memberDeclaration )* '}' -> ^( MEMBERS ( memberDeclaration )* ) ;
    public final ModelParser.classDeclarationBody_return classDeclarationBody() throws RecognitionException {
        ModelParser.classDeclarationBody_return retval = new ModelParser.classDeclarationBody_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token char_literal33=null;
        Token char_literal35=null;
        ModelParser.memberDeclaration_return memberDeclaration34 =null;


        ModelAST char_literal33_tree=null;
        ModelAST char_literal35_tree=null;
        RewriteRuleTokenStream stream_37=new RewriteRuleTokenStream(adaptor,"token 37");
        RewriteRuleTokenStream stream_38=new RewriteRuleTokenStream(adaptor,"token 38");
        RewriteRuleSubtreeStream stream_memberDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule memberDeclaration");
        try {
            // src/main/resources/Model.g:92:5: ( '{' ( memberDeclaration )* '}' -> ^( MEMBERS ( memberDeclaration )* ) )
            // src/main/resources/Model.g:92:9: '{' ( memberDeclaration )* '}'
            {
            char_literal33=(Token)match(input,37,FOLLOW_37_in_classDeclarationBody575);  
            stream_37.add(char_literal33);


            // src/main/resources/Model.g:92:13: ( memberDeclaration )*
            loop11:
            do {
                int alt11=2;
                int LA11_0 = input.LA(1);

                if ( (LA11_0==IDENTIFIER||(LA11_0 >= 27 && LA11_0 <= 28)||LA11_0==32||(LA11_0 >= 35 && LA11_0 <= 36)) ) {
                    alt11=1;
                }


                switch (alt11) {
            	case 1 :
            	    // src/main/resources/Model.g:92:13: memberDeclaration
            	    {
            	    pushFollow(FOLLOW_memberDeclaration_in_classDeclarationBody577);
            	    memberDeclaration34=memberDeclaration();

            	    state._fsp--;

            	    stream_memberDeclaration.add(memberDeclaration34.getTree());

            	    }
            	    break;

            	default :
            	    break loop11;
                }
            } while (true);


            char_literal35=(Token)match(input,38,FOLLOW_38_in_classDeclarationBody580);  
            stream_38.add(char_literal35);


            // AST REWRITE
            // elements: memberDeclaration
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 93:5: -> ^( MEMBERS ( memberDeclaration )* )
            {
                // src/main/resources/Model.g:93:9: ^( MEMBERS ( memberDeclaration )* )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(MEMBERS, "MEMBERS")
                , root_1);

                // src/main/resources/Model.g:93:19: ( memberDeclaration )*
                while ( stream_memberDeclaration.hasNext() ) {
                    adaptor.addChild(root_1, stream_memberDeclaration.nextTree());

                }
                stream_memberDeclaration.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "classDeclarationBody"


    public static class interfaceMemberDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "interfaceMemberDeclaration"
    // src/main/resources/Model.g:96:1: interfaceMemberDeclaration : ( fieldDeclaration | methodDeclaration | fieldIndexDeclaration );
    public final ModelParser.interfaceMemberDeclaration_return interfaceMemberDeclaration() throws RecognitionException {
        ModelParser.interfaceMemberDeclaration_return retval = new ModelParser.interfaceMemberDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        ModelParser.fieldDeclaration_return fieldDeclaration36 =null;

        ModelParser.methodDeclaration_return methodDeclaration37 =null;

        ModelParser.fieldIndexDeclaration_return fieldIndexDeclaration38 =null;



        try {
            // src/main/resources/Model.g:97:2: ( fieldDeclaration | methodDeclaration | fieldIndexDeclaration )
            int alt12=3;
            alt12 = dfa12.predict(input);
            switch (alt12) {
                case 1 :
                    // src/main/resources/Model.g:97:4: fieldDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_fieldDeclaration_in_interfaceMemberDeclaration612);
                    fieldDeclaration36=fieldDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, fieldDeclaration36.getTree());

                    }
                    break;
                case 2 :
                    // src/main/resources/Model.g:98:4: methodDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_methodDeclaration_in_interfaceMemberDeclaration617);
                    methodDeclaration37=methodDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, methodDeclaration37.getTree());

                    }
                    break;
                case 3 :
                    // src/main/resources/Model.g:99:4: fieldIndexDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_fieldIndexDeclaration_in_interfaceMemberDeclaration622);
                    fieldIndexDeclaration38=fieldIndexDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, fieldIndexDeclaration38.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "interfaceMemberDeclaration"


    public static class memberDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "memberDeclaration"
    // src/main/resources/Model.g:102:1: memberDeclaration : ( classDeclaration | interfaceDeclaration | interfaceMemberDeclaration );
    public final ModelParser.memberDeclaration_return memberDeclaration() throws RecognitionException {
        ModelParser.memberDeclaration_return retval = new ModelParser.memberDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        ModelParser.classDeclaration_return classDeclaration39 =null;

        ModelParser.interfaceDeclaration_return interfaceDeclaration40 =null;

        ModelParser.interfaceMemberDeclaration_return interfaceMemberDeclaration41 =null;



        try {
            // src/main/resources/Model.g:103:2: ( classDeclaration | interfaceDeclaration | interfaceMemberDeclaration )
            int alt13=3;
            switch ( input.LA(1) ) {
            case 35:
                {
                int LA13_1 = input.LA(2);

                if ( ((LA13_1 >= 27 && LA13_1 <= 28)||(LA13_1 >= 35 && LA13_1 <= 36)) ) {
                    alt13=1;
                }
                else if ( (LA13_1==32) ) {
                    alt13=2;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 13, 1, input);

                    throw nvae;

                }
                }
                break;
            case 27:
            case 28:
            case 36:
                {
                alt13=1;
                }
                break;
            case 32:
                {
                alt13=2;
                }
                break;
            case IDENTIFIER:
                {
                alt13=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 13, 0, input);

                throw nvae;

            }

            switch (alt13) {
                case 1 :
                    // src/main/resources/Model.g:103:4: classDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_classDeclaration_in_memberDeclaration633);
                    classDeclaration39=classDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, classDeclaration39.getTree());

                    }
                    break;
                case 2 :
                    // src/main/resources/Model.g:104:4: interfaceDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_interfaceDeclaration_in_memberDeclaration638);
                    interfaceDeclaration40=interfaceDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, interfaceDeclaration40.getTree());

                    }
                    break;
                case 3 :
                    // src/main/resources/Model.g:105:4: interfaceMemberDeclaration
                    {
                    root_0 = (ModelAST)adaptor.nil();


                    pushFollow(FOLLOW_interfaceMemberDeclaration_in_memberDeclaration643);
                    interfaceMemberDeclaration41=interfaceMemberDeclaration();

                    state._fsp--;

                    adaptor.addChild(root_0, interfaceMemberDeclaration41.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "memberDeclaration"


    public static class fieldDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "fieldDeclaration"
    // src/main/resources/Model.g:108:1: fieldDeclaration : fieldType IDENTIFIER '=' 'null' ';' -> ^( FIELD_DECL fieldType IDENTIFIER ) ;
    public final ModelParser.fieldDeclaration_return fieldDeclaration() throws RecognitionException {
        ModelParser.fieldDeclaration_return retval = new ModelParser.fieldDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token IDENTIFIER43=null;
        Token char_literal44=null;
        Token string_literal45=null;
        Token char_literal46=null;
        ModelParser.fieldType_return fieldType42 =null;


        ModelAST IDENTIFIER43_tree=null;
        ModelAST char_literal44_tree=null;
        ModelAST string_literal45_tree=null;
        ModelAST char_literal46_tree=null;
        RewriteRuleTokenStream stream_33=new RewriteRuleTokenStream(adaptor,"token 33");
        RewriteRuleTokenStream stream_24=new RewriteRuleTokenStream(adaptor,"token 24");
        RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
        RewriteRuleTokenStream stream_25=new RewriteRuleTokenStream(adaptor,"token 25");
        RewriteRuleSubtreeStream stream_fieldType=new RewriteRuleSubtreeStream(adaptor,"rule fieldType");
        try {
            // src/main/resources/Model.g:109:2: ( fieldType IDENTIFIER '=' 'null' ';' -> ^( FIELD_DECL fieldType IDENTIFIER ) )
            // src/main/resources/Model.g:109:4: fieldType IDENTIFIER '=' 'null' ';'
            {
            pushFollow(FOLLOW_fieldType_in_fieldDeclaration654);
            fieldType42=fieldType();

            state._fsp--;

            stream_fieldType.add(fieldType42.getTree());

            IDENTIFIER43=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_fieldDeclaration656);  
            stream_IDENTIFIER.add(IDENTIFIER43);


            char_literal44=(Token)match(input,25,FOLLOW_25_in_fieldDeclaration658);  
            stream_25.add(char_literal44);


            string_literal45=(Token)match(input,33,FOLLOW_33_in_fieldDeclaration660);  
            stream_33.add(string_literal45);


            char_literal46=(Token)match(input,24,FOLLOW_24_in_fieldDeclaration662);  
            stream_24.add(char_literal46);


            // AST REWRITE
            // elements: fieldType, IDENTIFIER
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 110:2: -> ^( FIELD_DECL fieldType IDENTIFIER )
            {
                // src/main/resources/Model.g:110:5: ^( FIELD_DECL fieldType IDENTIFIER )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(FIELD_DECL, "FIELD_DECL")
                , root_1);

                adaptor.addChild(root_1, stream_fieldType.nextTree());

                adaptor.addChild(root_1, 
                stream_IDENTIFIER.nextNode()
                );

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "fieldDeclaration"


    public static class methodDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "methodDeclaration"
    // src/main/resources/Model.g:113:1: methodDeclaration : fieldType IDENTIFIER '(' ')' ';' -> ^( METHOD_DECL fieldType IDENTIFIER ) ;
    public final ModelParser.methodDeclaration_return methodDeclaration() throws RecognitionException {
        ModelParser.methodDeclaration_return retval = new ModelParser.methodDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token IDENTIFIER48=null;
        Token char_literal49=null;
        Token char_literal50=null;
        Token char_literal51=null;
        ModelParser.fieldType_return fieldType47 =null;


        ModelAST IDENTIFIER48_tree=null;
        ModelAST char_literal49_tree=null;
        ModelAST char_literal50_tree=null;
        ModelAST char_literal51_tree=null;
        RewriteRuleTokenStream stream_21=new RewriteRuleTokenStream(adaptor,"token 21");
        RewriteRuleTokenStream stream_20=new RewriteRuleTokenStream(adaptor,"token 20");
        RewriteRuleTokenStream stream_24=new RewriteRuleTokenStream(adaptor,"token 24");
        RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
        RewriteRuleSubtreeStream stream_fieldType=new RewriteRuleSubtreeStream(adaptor,"rule fieldType");
        try {
            // src/main/resources/Model.g:114:2: ( fieldType IDENTIFIER '(' ')' ';' -> ^( METHOD_DECL fieldType IDENTIFIER ) )
            // src/main/resources/Model.g:114:4: fieldType IDENTIFIER '(' ')' ';'
            {
            pushFollow(FOLLOW_fieldType_in_methodDeclaration685);
            fieldType47=fieldType();

            state._fsp--;

            stream_fieldType.add(fieldType47.getTree());

            IDENTIFIER48=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_methodDeclaration687);  
            stream_IDENTIFIER.add(IDENTIFIER48);


            char_literal49=(Token)match(input,20,FOLLOW_20_in_methodDeclaration689);  
            stream_20.add(char_literal49);


            char_literal50=(Token)match(input,21,FOLLOW_21_in_methodDeclaration691);  
            stream_21.add(char_literal50);


            char_literal51=(Token)match(input,24,FOLLOW_24_in_methodDeclaration693);  
            stream_24.add(char_literal51);


            // AST REWRITE
            // elements: IDENTIFIER, fieldType
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 115:2: -> ^( METHOD_DECL fieldType IDENTIFIER )
            {
                // src/main/resources/Model.g:115:5: ^( METHOD_DECL fieldType IDENTIFIER )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(METHOD_DECL, "METHOD_DECL")
                , root_1);

                adaptor.addChild(root_1, stream_fieldType.nextTree());

                adaptor.addChild(root_1, 
                stream_IDENTIFIER.nextNode()
                );

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "methodDeclaration"


    public static class type_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "type"
    // src/main/resources/Model.g:118:1: type : qualifiedName ;
    public final ModelParser.type_return type() throws RecognitionException {
        ModelParser.type_return retval = new ModelParser.type_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        ModelParser.qualifiedName_return qualifiedName52 =null;



        try {
            // src/main/resources/Model.g:119:5: ( qualifiedName )
            // src/main/resources/Model.g:119:9: qualifiedName
            {
            root_0 = (ModelAST)adaptor.nil();


            pushFollow(FOLLOW_qualifiedName_in_type720);
            qualifiedName52=qualifiedName();

            state._fsp--;

            adaptor.addChild(root_0, qualifiedName52.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "type"


    public static class fieldType_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "fieldType"
    // src/main/resources/Model.g:122:1: fieldType : type ! relation[$type.tree] ;
    public final ModelParser.fieldType_return fieldType() throws RecognitionException {
        ModelParser.fieldType_return retval = new ModelParser.fieldType_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        ModelParser.type_return type53 =null;

        ModelParser.relation_return relation54 =null;



        try {
            // src/main/resources/Model.g:123:5: ( type ! relation[$type.tree] )
            // src/main/resources/Model.g:123:9: type ! relation[$type.tree]
            {
            root_0 = (ModelAST)adaptor.nil();


            pushFollow(FOLLOW_type_in_fieldType740);
            type53=type();

            state._fsp--;


            pushFollow(FOLLOW_relation_in_fieldType743);
            relation54=relation((type53!=null?((ModelAST)type53.tree):null));

            state._fsp--;

            adaptor.addChild(root_0, relation54.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "fieldType"


    public static class relation_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "relation"
    // src/main/resources/Model.g:126:1: relation[CommonTree entity] : ( ( '[]' ) -> ^( REL_DECL ) | -> ^( TYPE_DECL ) );
    public final ModelParser.relation_return relation(CommonTree entity) throws RecognitionException {
        ModelParser.relation_return retval = new ModelParser.relation_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token string_literal55=null;

        ModelAST string_literal55_tree=null;
        RewriteRuleTokenStream stream_26=new RewriteRuleTokenStream(adaptor,"token 26");

        try {
            // src/main/resources/Model.g:127:2: ( ( '[]' ) -> ^( REL_DECL ) | -> ^( TYPE_DECL ) )
            int alt14=2;
            int LA14_0 = input.LA(1);

            if ( (LA14_0==26) ) {
                alt14=1;
            }
            else if ( (LA14_0==IDENTIFIER) ) {
                alt14=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 14, 0, input);

                throw nvae;

            }
            switch (alt14) {
                case 1 :
                    // src/main/resources/Model.g:127:6: ( '[]' )
                    {
                    // src/main/resources/Model.g:127:6: ( '[]' )
                    // src/main/resources/Model.g:127:7: '[]'
                    {
                    string_literal55=(Token)match(input,26,FOLLOW_26_in_relation764);  
                    stream_26.add(string_literal55);


                    }


                    // AST REWRITE
                    // elements: 
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (ModelAST)adaptor.nil();
                    // 127:13: -> ^( REL_DECL )
                    {
                        // src/main/resources/Model.g:127:17: ^( REL_DECL )
                        {
                        ModelAST root_1 = (ModelAST)adaptor.nil();
                        root_1 = (ModelAST)adaptor.becomeRoot(
                        (ModelAST)adaptor.create(REL_DECL, "REL_DECL")
                        , root_1);

                        adaptor.addChild(root_1, entity);

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    // src/main/resources/Model.g:128:4: 
                    {
                    // AST REWRITE
                    // elements: 
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    // wildcard labels: 
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (ModelAST)adaptor.nil();
                    // 128:4: -> ^( TYPE_DECL )
                    {
                        // src/main/resources/Model.g:128:8: ^( TYPE_DECL )
                        {
                        ModelAST root_1 = (ModelAST)adaptor.nil();
                        root_1 = (ModelAST)adaptor.becomeRoot(
                        (ModelAST)adaptor.create(TYPE_DECL, "TYPE_DECL")
                        , root_1);

                        adaptor.addChild(root_1, entity);

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "relation"


    public static class fieldIndexDeclaration_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "fieldIndexDeclaration"
    // src/main/resources/Model.g:131:1: fieldIndexDeclaration : fieldType IDENTIFIER indexList ';' -> ^( INDX_DECL fieldType IDENTIFIER indexList ) ;
    public final ModelParser.fieldIndexDeclaration_return fieldIndexDeclaration() throws RecognitionException {
        ModelParser.fieldIndexDeclaration_return retval = new ModelParser.fieldIndexDeclaration_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token IDENTIFIER57=null;
        Token char_literal59=null;
        ModelParser.fieldType_return fieldType56 =null;

        ModelParser.indexList_return indexList58 =null;


        ModelAST IDENTIFIER57_tree=null;
        ModelAST char_literal59_tree=null;
        RewriteRuleTokenStream stream_24=new RewriteRuleTokenStream(adaptor,"token 24");
        RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
        RewriteRuleSubtreeStream stream_indexList=new RewriteRuleSubtreeStream(adaptor,"rule indexList");
        RewriteRuleSubtreeStream stream_fieldType=new RewriteRuleSubtreeStream(adaptor,"rule fieldType");
        try {
            // src/main/resources/Model.g:132:2: ( fieldType IDENTIFIER indexList ';' -> ^( INDX_DECL fieldType IDENTIFIER indexList ) )
            // src/main/resources/Model.g:132:4: fieldType IDENTIFIER indexList ';'
            {
            pushFollow(FOLLOW_fieldType_in_fieldIndexDeclaration797);
            fieldType56=fieldType();

            state._fsp--;

            stream_fieldType.add(fieldType56.getTree());

            IDENTIFIER57=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_fieldIndexDeclaration799);  
            stream_IDENTIFIER.add(IDENTIFIER57);


            pushFollow(FOLLOW_indexList_in_fieldIndexDeclaration801);
            indexList58=indexList();

            state._fsp--;

            stream_indexList.add(indexList58.getTree());

            char_literal59=(Token)match(input,24,FOLLOW_24_in_fieldIndexDeclaration803);  
            stream_24.add(char_literal59);


            // AST REWRITE
            // elements: IDENTIFIER, indexList, fieldType
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 133:2: -> ^( INDX_DECL fieldType IDENTIFIER indexList )
            {
                // src/main/resources/Model.g:133:5: ^( INDX_DECL fieldType IDENTIFIER indexList )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(INDX_DECL, "INDX_DECL")
                , root_1);

                adaptor.addChild(root_1, stream_fieldType.nextTree());

                adaptor.addChild(root_1, 
                stream_IDENTIFIER.nextNode()
                );

                adaptor.addChild(root_1, stream_indexList.nextTree());

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "fieldIndexDeclaration"


    public static class indexList_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "indexList"
    // src/main/resources/Model.g:136:1: indexList : '=' '{' '\"' IDENTIFIER '\"' ( ',' '\"' IDENTIFIER '\"' )* '}' -> ^( IDXF_DECL ( IDENTIFIER )+ ) ;
    public final ModelParser.indexList_return indexList() throws RecognitionException {
        ModelParser.indexList_return retval = new ModelParser.indexList_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token char_literal60=null;
        Token char_literal61=null;
        Token char_literal62=null;
        Token IDENTIFIER63=null;
        Token char_literal64=null;
        Token char_literal65=null;
        Token char_literal66=null;
        Token IDENTIFIER67=null;
        Token char_literal68=null;
        Token char_literal69=null;

        ModelAST char_literal60_tree=null;
        ModelAST char_literal61_tree=null;
        ModelAST char_literal62_tree=null;
        ModelAST IDENTIFIER63_tree=null;
        ModelAST char_literal64_tree=null;
        ModelAST char_literal65_tree=null;
        ModelAST char_literal66_tree=null;
        ModelAST IDENTIFIER67_tree=null;
        ModelAST char_literal68_tree=null;
        ModelAST char_literal69_tree=null;
        RewriteRuleTokenStream stream_19=new RewriteRuleTokenStream(adaptor,"token 19");
        RewriteRuleTokenStream stream_22=new RewriteRuleTokenStream(adaptor,"token 22");
        RewriteRuleTokenStream stream_IDENTIFIER=new RewriteRuleTokenStream(adaptor,"token IDENTIFIER");
        RewriteRuleTokenStream stream_25=new RewriteRuleTokenStream(adaptor,"token 25");
        RewriteRuleTokenStream stream_37=new RewriteRuleTokenStream(adaptor,"token 37");
        RewriteRuleTokenStream stream_38=new RewriteRuleTokenStream(adaptor,"token 38");

        try {
            // src/main/resources/Model.g:137:2: ( '=' '{' '\"' IDENTIFIER '\"' ( ',' '\"' IDENTIFIER '\"' )* '}' -> ^( IDXF_DECL ( IDENTIFIER )+ ) )
            // src/main/resources/Model.g:137:4: '=' '{' '\"' IDENTIFIER '\"' ( ',' '\"' IDENTIFIER '\"' )* '}'
            {
            char_literal60=(Token)match(input,25,FOLLOW_25_in_indexList828);  
            stream_25.add(char_literal60);


            char_literal61=(Token)match(input,37,FOLLOW_37_in_indexList830);  
            stream_37.add(char_literal61);


            char_literal62=(Token)match(input,19,FOLLOW_19_in_indexList834);  
            stream_19.add(char_literal62);


            IDENTIFIER63=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_indexList836);  
            stream_IDENTIFIER.add(IDENTIFIER63);


            char_literal64=(Token)match(input,19,FOLLOW_19_in_indexList838);  
            stream_19.add(char_literal64);


            // src/main/resources/Model.g:138:22: ( ',' '\"' IDENTIFIER '\"' )*
            loop15:
            do {
                int alt15=2;
                int LA15_0 = input.LA(1);

                if ( (LA15_0==22) ) {
                    alt15=1;
                }


                switch (alt15) {
            	case 1 :
            	    // src/main/resources/Model.g:138:23: ',' '\"' IDENTIFIER '\"'
            	    {
            	    char_literal65=(Token)match(input,22,FOLLOW_22_in_indexList841);  
            	    stream_22.add(char_literal65);


            	    char_literal66=(Token)match(input,19,FOLLOW_19_in_indexList843);  
            	    stream_19.add(char_literal66);


            	    IDENTIFIER67=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_indexList845);  
            	    stream_IDENTIFIER.add(IDENTIFIER67);


            	    char_literal68=(Token)match(input,19,FOLLOW_19_in_indexList847);  
            	    stream_19.add(char_literal68);


            	    }
            	    break;

            	default :
            	    break loop15;
                }
            } while (true);


            char_literal69=(Token)match(input,38,FOLLOW_38_in_indexList854);  
            stream_38.add(char_literal69);


            // AST REWRITE
            // elements: IDENTIFIER
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 140:2: -> ^( IDXF_DECL ( IDENTIFIER )+ )
            {
                // src/main/resources/Model.g:140:5: ^( IDXF_DECL ( IDENTIFIER )+ )
                {
                ModelAST root_1 = (ModelAST)adaptor.nil();
                root_1 = (ModelAST)adaptor.becomeRoot(
                (ModelAST)adaptor.create(IDXF_DECL, "IDXF_DECL")
                , root_1);

                if ( !(stream_IDENTIFIER.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_IDENTIFIER.hasNext() ) {
                    adaptor.addChild(root_1, 
                    stream_IDENTIFIER.nextNode()
                    );

                }
                stream_IDENTIFIER.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "indexList"


    public static class typeList_return extends ParserRuleReturnScope {
        ModelAST tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "typeList"
    // src/main/resources/Model.g:144:1: typeList : type ( ',' type )* -> ( type )+ ;
    public final ModelParser.typeList_return typeList() throws RecognitionException {
        ModelParser.typeList_return retval = new ModelParser.typeList_return();
        retval.start = input.LT(1);


        ModelAST root_0 = null;

        Token char_literal71=null;
        ModelParser.type_return type70 =null;

        ModelParser.type_return type72 =null;


        ModelAST char_literal71_tree=null;
        RewriteRuleTokenStream stream_22=new RewriteRuleTokenStream(adaptor,"token 22");
        RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type");
        try {
            // src/main/resources/Model.g:145:5: ( type ( ',' type )* -> ( type )+ )
            // src/main/resources/Model.g:145:9: type ( ',' type )*
            {
            pushFollow(FOLLOW_type_in_typeList882);
            type70=type();

            state._fsp--;

            stream_type.add(type70.getTree());

            // src/main/resources/Model.g:145:14: ( ',' type )*
            loop16:
            do {
                int alt16=2;
                int LA16_0 = input.LA(1);

                if ( (LA16_0==22) ) {
                    alt16=1;
                }


                switch (alt16) {
            	case 1 :
            	    // src/main/resources/Model.g:145:15: ',' type
            	    {
            	    char_literal71=(Token)match(input,22,FOLLOW_22_in_typeList885);  
            	    stream_22.add(char_literal71);


            	    pushFollow(FOLLOW_type_in_typeList887);
            	    type72=type();

            	    state._fsp--;

            	    stream_type.add(type72.getTree());

            	    }
            	    break;

            	default :
            	    break loop16;
                }
            } while (true);


            // AST REWRITE
            // elements: type
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (ModelAST)adaptor.nil();
            // 146:5: -> ( type )+
            {
                if ( !(stream_type.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_type.hasNext() ) {
                    adaptor.addChild(root_0, stream_type.nextTree());

                }
                stream_type.reset();

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (ModelAST)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (ModelAST)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "typeList"

    // Delegated rules


    protected DFA12 dfa12 = new DFA12(this);
    static final String DFA12_eotS =
        "\12\uffff";
    static final String DFA12_eofS =
        "\12\uffff";
    static final String DFA12_minS =
        "\4\7\1\24\1\7\1\41\3\uffff";
    static final String DFA12_maxS =
        "\1\7\1\32\2\7\1\31\1\32\1\45\3\uffff";
    static final String DFA12_acceptS =
        "\7\uffff\1\2\1\1\1\3";
    static final String DFA12_specialS =
        "\12\uffff}>";
    static final String[] DFA12_transitionS = {
            "\1\1",
            "\1\4\17\uffff\1\2\2\uffff\1\3",
            "\1\5",
            "\1\4",
            "\1\7\4\uffff\1\6",
            "\1\4\17\uffff\1\2\2\uffff\1\3",
            "\1\10\3\uffff\1\11",
            "",
            "",
            ""
    };

    static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
    static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
    static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
    static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
    static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
    static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
    static final short[][] DFA12_transition;

    static {
        int numStates = DFA12_transitionS.length;
        DFA12_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
        }
    }

    class DFA12 extends DFA {

        public DFA12(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 12;
            this.eot = DFA12_eot;
            this.eof = DFA12_eof;
            this.min = DFA12_min;
            this.max = DFA12_max;
            this.accept = DFA12_accept;
            this.special = DFA12_special;
            this.transition = DFA12_transition;
        }
        public String getDescription() {
            return "96:1: interfaceMemberDeclaration : ( fieldDeclaration | methodDeclaration | fieldIndexDeclaration );";
        }
    }
 

    public static final BitSet FOLLOW_packageDeclaration_in_compilationUnit135 = new BitSet(new long[]{0x0000001998000000L});
    public static final BitSet FOLLOW_importDeclaration_in_compilationUnit148 = new BitSet(new long[]{0x0000001998000000L});
    public static final BitSet FOLLOW_typeDeclaration_in_compilationUnit161 = new BitSet(new long[]{0x0000001918000002L});
    public static final BitSet FOLLOW_34_in_packageDeclaration196 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_qualifiedName_in_packageDeclaration198 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_packageDeclaration200 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_31_in_importDeclaration221 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_qualifiedName_in_importDeclaration223 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_importDeclaration225 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENTIFIER_in_qualifiedName249 = new BitSet(new long[]{0x0000000000800002L});
    public static final BitSet FOLLOW_23_in_qualifiedName252 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_qualifiedName254 = new BitSet(new long[]{0x0000000000800002L});
    public static final BitSet FOLLOW_interfaceDeclaration_in_typeDeclaration280 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_classDeclaration_in_typeDeclaration290 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_35_in_modifiers317 = new BitSet(new long[]{0x0000001808000002L});
    public static final BitSet FOLLOW_27_in_modifiers327 = new BitSet(new long[]{0x0000001808000002L});
    public static final BitSet FOLLOW_36_in_modifiers335 = new BitSet(new long[]{0x0000001808000002L});
    public static final BitSet FOLLOW_35_in_interfaceDeclaration386 = new BitSet(new long[]{0x0000000100000000L});
    public static final BitSet FOLLOW_32_in_interfaceDeclaration390 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_interfaceDeclaration392 = new BitSet(new long[]{0x0000002020000000L});
    public static final BitSet FOLLOW_29_in_interfaceDeclaration403 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_type_in_interfaceDeclaration405 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_interfaceDeclarationBody_in_interfaceDeclaration411 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_modifiers_in_classDeclaration462 = new BitSet(new long[]{0x0000000010000000L});
    public static final BitSet FOLLOW_28_in_classDeclaration464 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_classDeclaration466 = new BitSet(new long[]{0x0000002040000000L});
    public static final BitSet FOLLOW_30_in_classDeclaration477 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_typeList_in_classDeclaration479 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_classDeclarationBody_in_classDeclaration491 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_37_in_interfaceDeclarationBody535 = new BitSet(new long[]{0x0000004000000080L});
    public static final BitSet FOLLOW_interfaceMemberDeclaration_in_interfaceDeclarationBody537 = new BitSet(new long[]{0x0000004000000080L});
    public static final BitSet FOLLOW_38_in_interfaceDeclarationBody540 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_37_in_classDeclarationBody575 = new BitSet(new long[]{0x0000005918000080L});
    public static final BitSet FOLLOW_memberDeclaration_in_classDeclarationBody577 = new BitSet(new long[]{0x0000005918000080L});
    public static final BitSet FOLLOW_38_in_classDeclarationBody580 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_fieldDeclaration_in_interfaceMemberDeclaration612 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_methodDeclaration_in_interfaceMemberDeclaration617 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_fieldIndexDeclaration_in_interfaceMemberDeclaration622 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_classDeclaration_in_memberDeclaration633 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_interfaceDeclaration_in_memberDeclaration638 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_interfaceMemberDeclaration_in_memberDeclaration643 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_fieldType_in_fieldDeclaration654 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_fieldDeclaration656 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_fieldDeclaration658 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_33_in_fieldDeclaration660 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_fieldDeclaration662 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_fieldType_in_methodDeclaration685 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_methodDeclaration687 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_20_in_methodDeclaration689 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_21_in_methodDeclaration691 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_methodDeclaration693 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_qualifiedName_in_type720 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_type_in_fieldType740 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_relation_in_fieldType743 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_26_in_relation764 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_fieldType_in_fieldIndexDeclaration797 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_fieldIndexDeclaration799 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_indexList_in_fieldIndexDeclaration801 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_fieldIndexDeclaration803 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_25_in_indexList828 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_indexList830 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_19_in_indexList834 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_indexList836 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_19_in_indexList838 = new BitSet(new long[]{0x0000004000400000L});
    public static final BitSet FOLLOW_22_in_indexList841 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_19_in_indexList843 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_IDENTIFIER_in_indexList845 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_19_in_indexList847 = new BitSet(new long[]{0x0000004000400000L});
    public static final BitSet FOLLOW_38_in_indexList854 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_type_in_typeList882 = new BitSet(new long[]{0x0000000000400002L});
    public static final BitSet FOLLOW_22_in_typeList885 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_type_in_typeList887 = new BitSet(new long[]{0x0000000000400002L});

}